const CounterAbout = {
  namespaced: true,
  state: {
    num: 0,
    name: "张涛",
    schoolName: '长春理工大学'
  },
  actions: {
    addOdd(context, n) {
      if (context.state.num % 2 != 0) {
        context.commit('ADDODD', n)
      }
    },
    addWait(context, n) {
      setTimeout(() => {
        context.commit('ADDWAIT', n)
      }, 500)
    }
  },
  mutations: {
    JIA(state, n) {
      state.num += n
    },
    JIAN(state, n) {
      state.num -= n
    },
    ADDODD(state, n) {
      state.num += n
    },
    ADDWAIT(state, n) {
      state.num += n
    }
  },
  getters: {
    bigNum(state) {
      return state.num * 10
    }
  }
}
export default CounterAbout